package io.kiki.sba.registry.store.jdbc.mapper;

import io.kiki.sba.registry.store.jdbc.domain.MultiClusterSyncDomain;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface MultiClusterSyncMapper {


    public int save(MultiClusterSyncDomain data);

    /**
     * update meta address with exceptVersion cas
     */
    public int update(@Param("data") MultiClusterSyncDomain data, @Param("exceptVersion") long exceptVersion);

    /**
     * query MultiClusterSyncInfo
     */
    public List<MultiClusterSyncDomain> queryByCluster(@Param("dataCenter") String dataCenter);

    /**
     * query MultiClusterSyncInfo
     */
    public MultiClusterSyncDomain query(@Param("dataCenter") String dataCenter, @Param("remoteDataCenter") String remoteDataCenter);

    /**
     * remove provideData
     */
    public int remove(@Param("dataCenter") String dataCenter, @Param("remoteDataCenter") String remoteDataCenter, @Param("dataVersion") long dataVersion);
}
